package com.wpw.web;

import java.io.*;

/**
 * @Description:
 * @ClassName: Test2
 * @CreateDate: 2019-12-01 23:02
 * @author: wupengwei
 */
public class Test2 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        SingleTest singleTest = SingleTest.getSingleTest();
        try (ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("/Users/set.obj"))) {
            oos.writeObject(singleTest);
        }


        SingleTest s;
        try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream("/Users/set.obj"))) {
            s = (SingleTest)ois.readObject();
        }
        System.out.println(singleTest == s);
    }
}